<template>
  <div>
    <div class="container">
      <div class="videoList" v-for="(temp,index) in miva" :key="index" @click="checked(temp)">
        <div class="video">
          <div class="videoImg">
            <el-image style="width:100%;height:100%" :src="temp.poster | cover" fit="cover"></el-image>
          </div>
          <otherInfo :value="temp"></otherInfo>
        </div>
      </div>
    </div>
    <div class="layer" v-show="show" @click="show = false">
      <layerInfo></layerInfo>
    </div>
  </div>
</template>

<script>
import otherInfo from "@/components/otherInfo";
import layerInfo from "@/components/layerInfo";
export default {
    filters: {
    cover(posters) {
      if (!posters) return "http://placehold.it/640x1280";
      return posters.split(",")[0];
    }
  },
  components: {
    otherInfo,
    layerInfo
  },
  props: {
    miva: {
      type: Array,
      required: true
    }
  },
  created() {
    console.log(this.miva);
    this.$store.commit("SETTING_HEADER_ACTIVE1", 3);
  },
  data() {
    return {
      show: false
    };
  },
  methods: {
    checked(value) {
      // this.show = true;
      // this.nowCheck = value;
      console.log(value);
      this.$store.commit("SETTING_MASK", { type: "video", data: value });
    }
  }
};
</script>

<style lang="less">
.container {
  width: 100%;
  padding: 10px 0;
  display: flex;
  justify-content: flex-start;
  flex-wrap: wrap;
  .videoList {
    box-sizing: border-box;
    padding: 10px 0;
    .video {
      width: 280px;
      height: 265px;
      margin: 0 10px;
      // border:1px solid #ccc;
      box-shadow: 0px 2px 25px 0px rgba(189, 189, 189, 0.3);
      border-radius: 10px;
      .videoImg {
        width: 100%;
        height: 180px;
        overflow: hidden;
        background: #dadada;
        border-radius: 10px 10px 0 0;
      }
    }
  }
}
</style>

